[IA64] All vcpus can sync interrupts from qemu
authorawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 24 Aug 2006 17:52:23 +0000 (11:52 -0600)
committerawilliam@xenbuild.aw <awilliam@xenbuild.aw>
Thu, 24 Aug 2006 17:52:23 +0000 (11:52 -0600)
Previously only vcpu0 can sync interrupt from qemu.
Now all vcpus can sync.

Signed-off-by: Anthony Xu <anthony.xu@intel.com>
xen/arch/ia64/vmx/vmx_init.c
xen/arch/ia64/vmx/vmx_support.c
xen/include/asm-ia64/domain.h
xen/include/asm-ia64/vmx_vpd.h

index bf85b7df0c4fc9faee4cae558ec0ef55d98c88ce..df1bc94de0706a3cd8c013741b63e55620876f92 100644 (file)
@@ -445,6 +445,9 @@ void vmx_setup_platform(struct domain *d)
        memset(&d->shared_info->evtchn_mask[0], 0xff,
            sizeof(d->shared_info->evtchn_mask));
 
+       /* initiate spinlock for pass virq */
+       spin_lock_init(&d->arch.arch_vmx.virq_assist_lock);
+
        /* Initialize the virtual interrupt lines */
        vmx_virq_line_init(d);
 
index 3f8c4bcf0c6beb871f91624597296ac21cdb0046..70b9dd73214a042f739411b658850b7a51109ec7 100644 (file)
@@ -73,8 +73,10 @@ void vmx_intr_assist(struct vcpu *v)
 {
 #ifdef V_IOSAPIC_READY
     /* Confirm virtual interrupt line signals, and set pending bits in vpd */
-    if(v->vcpu_id==0)
+    if (spin_trylock(&v->domain->arch.arch_vmx.virq_assist_lock)) {
         vmx_virq_line_assist(v);
+        spin_unlock(&v->domain->arch.arch_vmx.virq_assist_lock);
+    }
 #endif
     return;
 }
index 394b3bc6ad6fc9fb4eb70c2927764757fd2bdc09..0222115242fdc318c7468defb47af92f2a25467a 100644 (file)
@@ -137,6 +137,8 @@ struct arch_domain {
     atomic64_t shadow_fault_count;
 
     struct last_vcpu last_vcpu[NR_CPUS];
+
+    struct arch_vmx_domain arch_vmx; /* Virtual Machine Extensions */
 };
 #define INT_ENABLE_OFFSET(v)             \
     (sizeof(vcpu_info_t) * (v)->vcpu_id + \
index 82363a287655f69b64954d75439dec758d5b9fab..b534268ebbd52680cd7e12cb1cfe97f74eca2d57 100644 (file)
@@ -27,6 +27,7 @@
 #include <asm/vtm.h>
 #include <asm/vmx_platform.h>
 #include <public/xen.h>
+#include <xen/spinlock.h>
 
 #define VPD_SHIFT      17      /* 128K requirement */
 #define VPD_SIZE       (1 << VPD_SHIFT)
@@ -72,6 +73,11 @@ struct ivt_debug{
 };
 #define IVT_DEBUG_MAX 128
 #endif
+
+struct arch_vmx_domain {
+    spinlock_t virq_assist_lock; /* spinlock for pass virq */
+};
+
 struct arch_vmx_struct {
 //     vpd_t       *vpd;
     vtime_t        vtm;